package com.yanqu.road.entity.estatewar.palace;

import com.alibaba.fastjson.JSON;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.player.UserBaseInfo;

import java.util.Objects;

public class PalaceBattleRecord extends DataObject {
    private int activityId;
    private String recordUid;
    private boolean isWin;
    private long recordTime;
    private long userId;
    private long enemyUserId;
    private UserBaseInfo enemyUserInfo = new UserBaseInfo();
    private int oldPos;
    private int nowPos;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if(this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public String getRecordUid() {
        return recordUid;
    }

    public void setRecordUid(String recordUid) {
        if(!Objects.equals(this.recordUid, recordUid)) {
            this.recordUid = recordUid;
            setUpdateOption();
        }
    }

    public boolean isWin() {
        return isWin;
    }

    public void setWin(boolean win) {
        if(isWin != win) {
            isWin = win;
            setUpdateOption();
        }
    }

    public long getRecordTime() {
        return recordTime;
    }

    public void setRecordTime(long recordTime) {
        if(this.recordTime != recordTime) {
            this.recordTime = recordTime;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public long getEnemyUserId() {
        return enemyUserId;
    }

    public void setEnemyUserId(long enemyUserId) {
        if(this.enemyUserId != enemyUserId) {
            this.enemyUserId = enemyUserId;
            setUpdateOption();
        }
    }

    public UserBaseInfo getEnemyUserInfo() {
        return enemyUserInfo;
    }

    public void setEnemyUserInfo(UserBaseInfo enemyUserInfo) {
        if(!Objects.equals(this.enemyUserInfo, enemyUserInfo)) {
            this.enemyUserInfo = enemyUserInfo;
            setUpdateOption();
        }
    }

    public String getEnemyUserInfoJsonStr(){
        if(null == enemyUserInfo){
            return "{}";
        }else {
            return JSON.toJSONString(enemyUserInfo);
        }
    }

    public int getOldPos() {
        return oldPos;
    }

    public void setOldPos(int oldPos) {
        if(this.oldPos != oldPos) {
            this.oldPos = oldPos;
            setUpdateOption();
        }
    }

    public int getNowPos() {
        return nowPos;
    }

    public void setNowPos(int nowPos) {
        if(this.nowPos != nowPos) {
            this.nowPos = nowPos;
            setUpdateOption();
        }
    }
}
